home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre4.z / postgre4 / src / lib / H / access / relscan.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  2.8 KB  |  88 lines

  1. /*
  2.  * relscan.h --
  3.  *    POSTGRES internal relation scan descriptor definitions.
  4.  */
  5.  
  6. #ifndef    RelScanIncluded        /* Include this file only once */
  7. #define RelScanIncluded    1
  8.  
  9. /*
  10.  * Identification:
  11.  */
  12. #define RELSCAN_H    "$Header: /private/postgres/src/lib/H/access/RCS/relscan.h,v 1.12 1991/08/25 13:30:37 hong Exp $"
  13.  
  14. #include "tmp/c.h"
  15.  
  16. #include "access/skey.h"
  17. #include "storage/buf.h"
  18. #include "access/htup.h"
  19. #include "storage/itemptr.h"
  20. #include "access/tqual.h"
  21. #include "utils/rel.h"
  22.  
  23. typedef ItemPointerData    MarkData;
  24.  
  25. typedef struct HeapScanDescData {
  26.     Relation    rs_rd;        /* pointer to relation descriptor */
  27.     HeapTuple    rs_ptup;    /* previous tuple in scan */
  28.     HeapTuple    rs_ctup;    /* current tuple in scan */
  29.     HeapTuple    rs_ntup;    /* next tuple in scan */
  30.     Buffer        rs_pbuf;    /* previous buffer in scan */
  31.     Buffer        rs_cbuf;    /* current buffer in scan */
  32.     Buffer        rs_nbuf;    /* next buffer in scan */
  33.     struct    dchain    *rs_dc;        /* cached expanded delta chain */
  34.     ItemPointerData    rs_mptid;    /* marked previous tid */
  35.     ItemPointerData    rs_mctid;    /* marked current tid */
  36.     ItemPointerData    rs_mntid;    /* marked next tid */
  37.     ItemPointerData    rs_mcd;        /* marked current delta XXX ??? */
  38.     Boolean        rs_atend;    /* restart scan at end? */
  39.     TimeQual    rs_tr;        /* time qualification */
  40.     uint16        rs_cdelta;    /* current delta in chain */
  41.     bool        rs_parallel_ok; /* ok to parallelize? */
  42.     uint16        rs_nkeys;    /* number of attributes in keys */
  43.     ScanKeyData    rs_key;        /* key descriptors */
  44.     /* VARIABLE LENGTH ARRAY AT END OF STRUCT */
  45. } HeapScanDescData;
  46.  
  47. typedef HeapScanDescData *HeapScanDesc;
  48.  
  49. typedef struct IndexScanDescData {
  50.     Relation    relation;        /* relation descriptor */
  51.     Pointer        opaque;            /* am-specific slot */
  52.     ItemPointerData    previousItemData;    /* previous index pointer */
  53.     ItemPointerData    currentItemData;    /* current index pointer */
  54.     ItemPointerData    nextItemData;        /* next index pointer */
  55.     MarkData    previousMarkData;    /* marked previous pointer */
  56.     MarkData    currentMarkData;    /* marked current  pointer */
  57.     MarkData    nextMarkData;        /* marked next pointer */
  58.     uint8        flags;            /* scan position flags */
  59.     Boolean        scanFromEnd;        /* restart scan at end? */
  60.     uint16        numberOfKeys;        /* number of key attributes */
  61.     ScanKeyData    keyData;            /* key descriptor */
  62.     /* VARIABLE LENGTH ARRAY AT END OF STRUCT */
  63. } IndexScanDescData;
  64.  
  65. typedef IndexScanDescData    *IndexScanDesc;
  66.  
  67. /* ----------------
  68.  *    IndexScanDescPtr is used in the executor where we have to
  69.  *    keep track of several index scans when using several indices
  70.  *    - cim 9/10/89
  71.  * ----------------
  72.  */
  73. typedef IndexScanDesc        *IndexScanDescPtr;
  74.  
  75. /*
  76.  * HeapScanIsValid --
  77.  *    True iff the heap scan is valid.
  78.  */
  79. #define    HeapScanIsValid(scan) PointerIsValid(scan)
  80.  
  81. /*
  82.  * IndexScanIsValid --
  83.  *    True iff the index scan is valid.
  84.  */
  85. #define IndexScanIsValid(scan) PointerIsValid(scan)
  86.  
  87. #endif    /* !defined(RelScanIncluded) */
  88.